﻿//****************************************************************************
// Copyright (c) 2010 All Right Reserved, http://www.sublight.si/
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// The origin of this software must not be misrepresented; you must not claim
// that you wrote the original software. If you use this software in a product,
// an acknowledgment in the product documentation is required.
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// The source code of the program may be copied and used for educational,
// non-commercial purposes. The source code may be modified if desired,
// to suit the user.
//
// This notice may not be removed or altered from any source distribution.

using NConsoler;

namespace SublightCmd
{
    partial class Program
    {
        [Action("automatically download subtitle(s) for multiple video files (same as DownloadBatch)")]
        public static void Batch(
            [Required(Description = "Input directory")]
            string directory,
            [Required(Description = "File type filter")]
            string fileType,
            [Required(Description = "Subtitle languages")]
            string[] languages,
            [Optional(true, Description = "Scan recursive")]
            bool recursive,
            [Optional("", Description = "MaxDownloads|MaxRate|MinReports|Newest")]
            string priority,
            [Optional("", Description = "Sublight username for login.")]
            string username,
            [Optional("", Description = "Sublight password for login")]
            string password,
            [Optional(false, Description = "When searching subtitles for single language, language code is by default not appended.")]
            bool alwaysAppendLanguageCode,
            [Optional("", Description = "Subtitle encoding (utf-8, iso-8859-2, ... See also http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx)")]
            string encoding,
            [Optional(true, Description = "Skip movies which already have downloaded subtitles.")]
            bool smartDownload,
            [Optional("", Description = "Logs information to file.")]
            string logPath,
            [Optional("", Description = "Log level (Debug | Info | Tip | Download | Warning | Error)")]
            string logLevel,
            [Optional(false, Description = "Looks into 'languages' parameter and downloads only one language.")]
            bool reduceLanguageDownloads,
            [Optional(true, Description = "Do linked subtitles have priority when search returns linked and unlinked subtitles.")]
            bool linkedSubtitlesHavePriority,
            [Optional(false, Description = "Does application need user input to exit.")]
            bool waitForExit,
            [Optional(false, Description = "Does application try to guess title if movie is not linked.")]
            bool guessTitle
            )
        {
            DownloadBatch(directory, fileType, languages, recursive, priority, username, password,
                          alwaysAppendLanguageCode, encoding, smartDownload, logPath, logLevel, reduceLanguageDownloads,
                          linkedSubtitlesHavePriority, waitForExit, guessTitle);
        }
    }
}
